From: Tim Starling Date: Sat, 11 Sep 2004 09:35:24 +0000 (+0000) Subject: unreported bug in the new makeTitle(), disallow redirects to Special:Userlogout X-Git-Tag: 1.5.0alpha1~2025 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=8ca3f081358fefc00eb07c988f570d373bc6608f;p=lhc%2Fweb%2Fwiklou.git unreported bug in the new makeTitle(), disallow redirects to Special:Userlogout --- diff --git a/includes/Title.php b/includes/Title.php index 3a17b3b052..e577493538 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -147,7 +147,7 @@ class Title { $t->mFragment = ''; $t->mNamespace = $ns; $t->mDbkeyform = $title; - $t->mArticleID = ( $ns >= 0 ) ? 0 : -1; + $t->mArticleID = ( $ns >= 0 ) ? -1 : 0; $t->mUrlform = wfUrlencode( $title ); $t->mTextform = str_replace( '_', ' ', $title ); return $t; @@ -185,6 +185,10 @@ class Title { } $rt = Title::newFromText( $m[1] ); + # Disallow redirects to Special:Userlogout + if ( $rt->getNamespace() == NS_SPECIAL && preg_match( '/^Userlogout/i', $rt->getText ) ) { + $rt = NULL; + } } } return $rt;